@page
@{ Layout = "_LayoutHome"; }
@section Styles{
    <style>
        .el-form-item {
            margin-bottom: 0px;
        }
        body{
            padding: 0;
            margin: 0;
            background-color: #ffffff;
        }

        html{
            padding: 0;
            margin: 0;
            background-color: #ffffff;
        }
    </style>
}
<el-card class="rounded-0">
    <div class="d-flex align-items-center">
        <div class="flex-grow-1">
            <h2 class="h1 fw-bold"><nobr>课程中心</nobr></h2>
            <small>共 {{total}} 门课程</small>
        </div>
        <div>
            <el-form :inline="true" :model="form">
                <el-form-item label="">
                    <el-input clearable prefix-icon="el-icon-search" v-model="form.keyWords" placeholder="关键字"></el-input>
                </el-form-item>
                <el-form-item label="">
                    <el-select v-model="form.state" clearable placeholder="学习状态" class="w-100">
                        <el-option label="全部状态"
                                   value="">
                        </el-option>
                        <el-option label="已完成"
                                   value="stateOver">
                        </el-option>
                        <el-option label="学习中"
                                   value="stateStuding">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="">
                    <el-select v-model="form.orderby" clearable placeholder="默认排序" class="w-100">
                        <el-option label="默认排序"
                                   value="">
                        </el-option>
                        <el-option label="按评价"
                                   value="orderbyEvaluation">
                        </el-option>
                        <el-option label="按学习人数"
                                   value="orderbyCount">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="已收藏">
                    <el-checkbox v-model="form.collection">
                        <i class="bi bi-person-hearts me-2"></i>
                    </el-checkbox>
                </el-form-item>
                <div v-if="markTotal>0" class="mt-2">
                    <el-form-item label="标签">
                        <template v-for="mark in markShowList">
                            <el-tag v-if="form.mark===mark" size="mini" class="me-1 mb-1" v-on:click="marChangeClick(mark)" effect="dark" type="success" style="cursor:pointer;">{{ mark }}</el-tag>
                            <el-tag v-else size="mini" class="me-1 mb-1" v-on:click="marChangeClick(mark)" style="cursor:pointer;" effect="plain">{{ mark }}</el-tag>
                        </template>
                        <el-tag size="mini" v-on:click="moreMarkList" type="info" effect="plain" v-if="markMore" style="cursor:pointer;">more({{ markTotal-markShowList.length }})</el-tag>
                    </el-form-item>
                </div>
            </el-form>
        </div>
        <div>
            <el-button class="p-4" type="primary" plain icon="el-icon-search" v-on:click="btnSearchClick">查询</el-button>
        </div>
    </div>
</el-card>
<div class="p-3" v-if="total>0">
    <div class="row g-4">
        <div class="col-xl-3 col-lg-3 col-md-3 col-3">
            <div class="card card-lift card-hover border bg-white p-2 mb-3" v-on:click="btnViewClick(course)" style="cursor:pointer;" v-for="course in list1">
                <div class="position-relative">
                    <img :src="course.coverImg" class="img-fluid card-img">
                    <span class="px-2 rounded-3 bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6">{{ utils.formatDuration(course.duration) }}</span>
                    <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                    <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                    <span class="position-absolute bottom-0 start-0 m-2">
                        <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                        <el-tag size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                    </span>
                </div>
                <div class="card-body">
                    <h4 class="mb-3">
                        <a href="javascript:;" class="text-inherit">{{ course.name }}</a>
                    </h4>
                    <div class="mb-3 lh-1">
                        <span>
                            <i class="bi bi-star-fill text-warning me-2"></i>
                            <span class="text-inherit fw-semibold">{{ course.evaluationAvg }}</span>
                        </span>
                        <span class="mx-1">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                 fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                            </svg>
                        </span>
                        <span>
                            <i class="bi bi-person-video3 me-2"></i>
                            <span class="text-inherit fw-semibold">{{ course.totaEvaluationlUser }}</span>
                        </span>
                    </div>
                    <div class="lh-1">
                        <i class="bi bi-credit-card-2-front-fill me-2"></i><span class="text-inherit fw-semibold">{{ course.studyHour }}</span> 课时
                        <span class="mx-1">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                 fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                            </svg>
                        </span>
                        <span class="text-inherit fw-semibold text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }}学分</span>
                        <span class="text-inherit fw-semibold" v-else>{{ course.credit }}学分</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-3 col-lg-3 col-md-3 col-3">
            <div class="card card-lift card-hover border bg-white p-2 mb-3" v-on:click="btnViewClick(course)" style="cursor:pointer;" v-for="course in list2">
                <div class="position-relative">
                    <img :src="course.coverImg" class="img-fluid card-img">
                    <span class="px-2 rounded-3 bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6">{{ utils.formatDuration(course.duration) }}</span>
                    <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                    <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                    <span class="position-absolute bottom-0 start-0 m-2">
                        <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                        <el-tag size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                    </span>
                </div>
                <div class="card-body">
                    <h4 class="mb-3">
                        <a href="javascript:;" class="text-inherit">{{ course.name }}</a>
                    </h4>
                    <div class="mb-3 lh-1">
                        <span>
                            <i class="bi bi-star-fill text-warning me-2"></i>
                            <span class="text-inherit fw-semibold">{{ course.evaluationAvg }}</span>
                        </span>
                        <span class="mx-1">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                 fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                            </svg>
                        </span>
                        <span>
                            <i class="bi bi-person-video3 me-2"></i>
                            <span class="text-inherit fw-semibold">{{ course.totaEvaluationlUser }}</span>
                        </span>
                    </div>
                    <div class="lh-1">
                        <i class="bi bi-credit-card-2-front-fill me-2"></i><span class="text-inherit fw-semibold">{{ course.studyHour }}</span> 课时
                        <span class="mx-1">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                 fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                            </svg>
                        </span>
                        <span class="text-inherit fw-semibold text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }}学分</span>
                        <span class="text-inherit fw-semibold" v-else>{{ course.credit }}学分</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-3 col-lg-3 col-md-3 col-3">
            <div class="card card-lift card-hover border bg-white p-2 mb-3" v-on:click="btnViewClick(course)" style="cursor:pointer;" v-for="course in list3">
                <div class="position-relative">
                    <img :src="course.coverImg" class="img-fluid card-img">
                    <span class="px-2 rounded-3 bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6">{{ utils.formatDuration(course.duration) }}</span>
                    <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                    <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                    <span class="position-absolute bottom-0 start-0 m-2">
                        <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                        <el-tag size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                    </span>
                </div>
                <div class="card-body">
                    <h4 class="mb-3">
                        <a href="javascript:;" class="text-inherit">{{ course.name }}</a>
                    </h4>
                    <div class="mb-3 lh-1">
                        <span>
                            <i class="bi bi-star-fill text-warning me-2"></i>
                            <span class="text-inherit fw-semibold">{{ course.evaluationAvg }}</span>
                        </span>
                        <span class="mx-1">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                 fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                            </svg>
                        </span>
                        <span>
                            <i class="bi bi-person-video3 me-2"></i>
                            <span class="text-inherit fw-semibold">{{ course.totaEvaluationlUser }}</span>
                        </span>
                    </div>
                    <div class="lh-1">
                        <i class="bi bi-credit-card-2-front-fill me-2"></i><span class="text-inherit fw-semibold">{{ course.studyHour }}</span> 课时
                        <span class="mx-1">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                 fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                            </svg>
                        </span>
                        <span class="text-inherit fw-semibold text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }}学分</span>
                        <span class="text-inherit fw-semibold" v-else>{{ course.credit }}学分</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-3 col-lg-3 col-md-3 col-3">
            <div class="card card-lift card-hover border bg-white p-2 mb-3" v-on:click="btnViewClick(course)" style="cursor:pointer;" v-for="course in list4">
                <div class="position-relative">
                    <img :src="course.coverImg" class="img-fluid card-img">
                    <span class="px-2 rounded-3 bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6">{{ utils.formatDuration(course.duration) }}</span>
                    <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                    <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                    <span class="position-absolute bottom-0 start-0 m-2">
                        <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                        <el-tag size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                    </span>
                </div>
                <div class="card-body">
                    <h4 class="mb-3">
                        <a href="javascript:;" class="text-inherit">{{ course.name }}</a>
                    </h4>
                    <div class="mb-3 lh-1">
                        <span>
                            <i class="bi bi-star-fill text-warning me-2"></i>
                            <span class="text-inherit fw-semibold">{{ course.evaluationAvg }}</span>
                        </span>
                        <span class="mx-1">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                 fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                            </svg>
                        </span>
                        <span>
                            <i class="bi bi-person-video3 me-2"></i>
                            <span class="text-inherit fw-semibold">{{ course.totaEvaluationlUser }}</span>
                        </span>
                    </div>
                    <div class="lh-1">
                        <i class="bi bi-credit-card-2-front-fill me-2"></i><span class="text-inherit fw-semibold">{{ course.studyHour }}</span> 课时
                        <span class="mx-1">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
                                 fill="var(--gk-gray-400)" class="bi bi-dot" viewBox="0 0 16 16">
                                <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
                            </svg>
                        </span>
                        <span class="text-inherit fw-semibold text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }}学分</span>
                        <span class="text-inherit fw-semibold" v-else>{{ course.credit }}学分</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="my-5 text-center">
        <el-button icon="el-icon-refresh-right" v-if="total>pushTotal" v-on:click="btnLoadMoreClick" :loading="loadMoreLoading">加载更多</el-button>
        <small v-else>没有更多了</small>
    </div>
</div>
<div class="pt-10" v-else>
    <el-empty image="/sitefiles/assets/images/nodata.svg"></el-empty>
</div>

@section Scripts{
    <script src="/sitefiles/assets/js/home/study/studyCourse.js" type="text/javascript"></script>
}